package com.boxing.service;

import com.boxing.bean.User;
import com.boxing.bean.UserDesc;
import com.boxing.dao.UserDao;
import com.boxing.dao.UserDaoImpl;

/**
 * 处理业务逻辑
 */
public class UserService {
   private UserDao userDao =  new UserDaoImpl();

    /**
     * @return true 登录成功
     */
   public boolean login(User user){
       return userDao.verifyUser(user);
   }


   public boolean register(User user){
       // 数据校验的工作

       // 校验用户名是否重复

       return userDao.registerUser(user);
   }

    /**
     *
     * @param name
     * @return true 存在
     */
   public boolean existUser(String name){
       return userDao.existUser(name);
   }

   public UserDesc getUser(String name){
       return userDao.getUser(name);
   }

   public boolean editUser(UserDesc userDesc){
       return userDao.editUser(userDesc);
   }
    public boolean editIcon(UserDesc userDesc){
        return userDao.editIcon(userDesc);
    }

}
